class BaseFeature {
  Map _origin;

  BaseFeature(Map data) {
    _origin = data;
  }

  operator [](key) {
    return _origin[key];
  }

  operator []=(key, value) {
    _origin[key] = value;
  }

  get start => this['start'];
  get end => this['end'];
  set start(int start) => this['start'] = start;
  set end(int end) => this['end'] = end;

  String get source => this['source'];
  String get seq_id => this['seq_id'];
  set source(String source) => this['source'] = source;
  set seq_id(String seqId) => this['seq_id'] = seqId;

  Map get json => _origin;

  @override
  String toString() {
    return 'BaseFeature{$_origin}';
  }
}

class GffFeature extends BaseFeature {
  GffFeature(Map data) : super(data);

  get score => this['score'];
  String get type => this['type'];

  String get strand => this['strand'];
  get phase => this['phase'];
  Map get attributes => this['attributes'];

  set score(double score) => this['score'] = score;
  set strand(String strand) => this['strand'] = strand;
}

class DirectiveFeature extends BaseFeature {
  DirectiveFeature(Map data) : super(data);
  String get directive => this['directive'];
  set directive(String directive) => this['directive'] = directive;

  String get value => this['value'];
  set value(String value) => this['value'] = value;

  String get buildName => this['value'];
  set buildName(String buildName) => this['value'] = buildName;
}

class CommentFeature extends BaseFeature {
  CommentFeature(Map data) : super(data);
  String get comment => this['comment'];
  set comment(String comment) => this['comment'] = comment;
}
